home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ufw.postinst < prev    next >
Text File  |  2008-10-08  |  1KB  |  56 lines

  1. #!/bin/sh -e
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. RULES_PATH="/etc/ufw"
  6. USER_PATH="/var/lib/ufw"
  7. TEMPLATE_PATH="/usr/share/ufw"
  8. case "$1" in
  9.     configure)
  10.         # these files are required, but don't want to change them if
  11.         # the user modified them
  12.         for f in before.rules before6.rules after.rules after6.rules
  13.         do
  14.             ucf --debconf-ok $TEMPLATE_PATH/$f $RULES_PATH/$f
  15.         done
  16.  
  17.         if [ -e "/etc/ufw/ufw.rules" ]; then
  18.             mv -f /etc/ufw/ufw.rules /etc/ufw/ufw.rules.dpkg-old
  19.         fi
  20.  
  21.         for f in user.rules user6.rules
  22.         do
  23.             if [ ! -e "$USER_PATH/$f" ]; then
  24.                 # if no config, copy the template
  25.                 cp $TEMPLATE_PATH/$f $USER_PATH/$f
  26.             fi
  27.         done
  28.  
  29.         if [ ! -e "/etc/ufw/ufw.conf" ]; then
  30.             cp $TEMPLATE_PATH/ufw.conf /etc/ufw
  31.         fi
  32.  
  33.         update-rc.d ufw start 39 S . stop 39 0 1 6 . > /dev/null
  34.         ;;
  35.     triggered)
  36.         ufw app update all
  37.         exit 0
  38.         ;;
  39.     abort-upgrade|abort-remove|abort-deconfigure)
  40.         ;;
  41.     *)
  42.         echo "postinst called with unknown argument '$1'" >&2
  43.         exit 1
  44.         ;;
  45. esac
  46.  
  47. # Automatically added by dh_pycentral
  48. if which pycentral >/dev/null 2>&1; then
  49.     pycentral pkginstall ufw
  50.     if grep -qs '^ufw$' /var/lib/pycentral/delayed-pkgs; then
  51.         sed -i '/^ufw$/d' /var/lib/pycentral/delayed-pkgs
  52.     fi
  53. fi
  54. # End automatically added section
  55.  
  56.